﻿
@model Entidades.Seguridad.Formulario


@{
    ViewBag.Title = "Crear";
    List<Entidades.Seguridad.Permiso> listPermisos = ViewBag.Permisos;
}

<link href="../../Content/themes/bootstrap.extra.table.css" rel="stylesheet" />
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@{Html.EnableClientValidation(true);}
@{Html.EnableUnobtrusiveJavaScript(true);}

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
         <legend>Create Formulario</legend>

        <div class="clearfix">

            @Html.LabelFor(model => model.IdFormulario)
            @Html.HiddenFor(model => model.IdFormulario)
        
        <div class="input">

            @Html.TextBoxFor(model => model.IdFormulario, new { disabled = "disabled", @readonly = "readonly" })

            @Html.ValidationMessageFor(model => model.IdFormulario)
        </div>
		</div>


        <div class="clearfix">

            @Html.LabelFor(model => model.Nombre)

        
        <div class="input">

            @Html.EditorFor(model => model.Nombre)

            @Html.ValidationMessageFor(model => model.Nombre)
        </div>
		</div>


        <div class="clearfix">

            @Html.LabelFor(model => model.Descripcion)

        
            <div class="input">

                @Html.EditorFor(model => model.Descripcion)

                @Html.ValidationMessageFor(model => model.Descripcion)
            </div>
        </div>
        
        <div class="clearfix">
            <label for="permisoschecks">Permisos</label>
            <div class="input">
                    @foreach (var c in listPermisos)
                    {
                        <p>
                            <input type="checkbox" name="permisoschecks" value="@c.IdPermiso"> @c.Nombre
                        </p>
                    }
            </div>
        </div>


        <div class="actions">
            <input type="submit" class="btn primary" value="Guardar" />
			@Html.ActionLink("Cancelar", "Index", null, new { @class = "btn"})
        </div>
    </fieldset>
}



